<?php

namespace app\admin\model;

use think\Model;


class Look extends Model
{

    

    

    // 表名
    protected $name = 'look';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'create_time_text'
    ];
    public function getCreateTimeTextAttr($value,$data)
    {
        return date('Y-m-d H:i',$data['create_time']);
    }

    public function getImageAttr($value, $data){
        if(!empty($value)) return cdnurl($value,true);
        return "";
    }



}
